In the digital world, JPEG is a commonly used method for compressing and storing digital images. The term “JPEG” stands for Joint Photographic Experts Group, and is the name of a standards committee that created the JPEG standard, among other standards. The JPEG standard defines how an image is compressed into a stream of bytes and decompressed back into an image. The standard enables a user to adjust the degree of compression of an image, and thereby allows for a selectable tradeoff between storage size for the compressed image, and the resulting image's quality when subsequently uncompressed.
However, many computing systems may be constrained in a size of storage space that may be allocated to storing images. Thus, the JPEG compression method appears to be a desirable method to use. However, current implementations of the JPEG compression algorithms often require the user to encode, or compress, an image a plurality of times in order to first obtain an estimate of a scale factor or quantization value that may then be used to obtain a desired preset target size of the compressed image. If the size of the compressed image exceeds the preset target size, then further compressions of the image may be required. Should the resulting size of the compressed image significantly undershoot the preset target size, then further compressions may again be required. This may be the case, for example, where underutilizing storage size may result in wasting space that might not be useable for storing other compressed images.
Moreover, because the quantization factor which is defined by the JPEG standard is fixed for the entire image and do not provide for bit rate control during the compression of the image. Thus, it is with respect to these considerations and others that the present invention has been made.